<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

<h:head>
	<title>祖龙娱乐  - BI系统</title>
	<link href="../../css/component.css" rel="stylesheet" type="text/css" />
</h:head>

<h:body>
	<span class="pagetitle">流水查询 ——实时装备消耗</span>
	<p:separator />
	
	<!-- 右侧页面顶部查询部分 -->
	<h:form id="fsearch">
		<p:growl id="growl" showDetail="true" sticky="false" life="5000"/>
		
		<p:dataTable id="dlist0" value="#{equipmentDecomposeAction}" var="l" scrollable="true" resizableColumns="true" paginator="false" style="text-align:center;">
			<p:column headerText="开始日期" styleClass="column" style="width:130px">
				<p:calendar value="#{l.dateStart}" mode="popup" pattern="yyyy-MM-dd" />
			</p:column>
			<p:column headerText="结束日期" styleClass="column" style="width:130px">
				<p:calendar value="#{l.dateEnd}" mode="popup" pattern="yyyy-MM-dd" />
			</p:column>
			<p:column headerText="平台" styleClass="column" style="width:70px">
				<p:selectOneMenu id="platformSel" styleClass="queryPlatform" value="#{l.queryPlatform}">
			        <f:selectItems value="#{l.platformItmes}" />
			        <p:ajax update="channelSel serverSel" listener="#{l.selectPlatformItems}" />
		        </p:selectOneMenu>
			</p:column>
			<p:column headerText="渠道" styleClass="column" style="width:100px">
				<p:selectOneMenu id="channelSel" styleClass="queryChannel" value="#{l.queryChannel}">
			        <f:selectItems value="#{l.channelItmes}" />
			        <p:ajax update="serverSel platformSel" listener="#{l.selectChannelItems}" />
		        </p:selectOneMenu>
			</p:column>
			<p:column headerText="区服" styleClass="column" style="width:100px">
				<p:selectOneMenu id="serverSel" styleClass="queryServer" value="#{l.queryServer}">
			         <f:selectItems value="#{l.serverItmes}" />
			         <p:ajax update="channelSel platformSel" listener="#{l.selectServerItems}" />
		        </p:selectOneMenu>
			</p:column>
			<p:column headerText="帐号ID" styleClass="column" style="width:120px">
				<h:inputText value="#{l.userId}"  style="width:94%"/>
			</p:column>
			<p:column headerText="角色ID" styleClass="column" style="width:100px">
				<h:inputText value="#{l.roleId}"  style="width:94%" />
			</p:column>
            <p:column headerText="消耗类型" styleClass="column" style="width:120px">
                <p:selectOneMenu styleClass="queryServer" value="#{l.decomType}">
                    <f:selectItems value="#{l.decomTypeList}" />
                </p:selectOneMenu>
            </p:column>
            <p:column headerText="操作" style="width:80px">
				<p:commandButton value="查询" action="#{l.search()}" update=":dform:panel1 :fsearch:growl :fsearch:dlist0"/>
			</p:column>
        </p:dataTable>
	</h:form>
	<br />
	<!-- 数据展示部分，包含表格和图表 -->
	<h:form id="dform">
		<div class="data" id="data">
			<p:panel id="panel1" header="查询结果" style="margin-bottom:10px;">
				<h:commandLink rendered="#{equipmentDecomposeAction.result != null and equipmentDecomposeAction.result.size() > 0}">
					<p:graphicImage url="/resources/images/excel.png" height="25px" />
					<p:dataExporter type="xls" target="dlist1" fileName="EquipmentDecomposeFlow-#{pageHelper.getNewDateDetailStr()}" />
				</h:commandLink>
				<p:dataTable id="dlist1" var="l" value="#{equipmentDecomposeAction.result}" scrollable="true" resizableColumns="true" paginator="true" paginatorPosition="top" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="15,30" rows="30" style="text-align:center;">
					<p:column headerText="时间" styleClass="column" style="width:120px">
						<h:outputLabel value="#{l[0]}" style="width:100%" />
					</p:column>
					<p:column headerText="平台" styleClass="column" style="width:80px">
						<h:outputLabel value="#{pageHelper.getPlatformNameById(l[1].toString())}"  style="width:100%"/>
					</p:column>
					<p:column headerText="渠道" styleClass="column" style="width:80px">
						<h:outputLabel value="#{pageHelper.getChannelNameById(l[2].toString())}"  style="width:100%"/>
					</p:column>
					<p:column headerText="区服" styleClass="column" style="width:80px">
						<h:outputLabel value="#{pageHelper.getServerNameById(l[3].toString())}"  style="width:100%"/>
					</p:column>
					<p:column headerText="账号ID" styleClass="column" style="width:200px">
						<h:outputLabel value="#{l[4]}"  style="width:100%"/>
					</p:column>
					<p:column headerText="角色ID" styleClass="column" style="width:150px">
						<h:outputLabel value="#{l[5]}"  style="width:100%"/>
					</p:column>
                    <p:column headerText="角色等级" styleClass="column" style="width:50px">
                        <h:outputLabel value="#{l[6]}"  style="width:100%"/>
                    </p:column>
                    <p:column headerText="VIP等级" styleClass="column" style="width:50px">
                        <h:outputLabel value="#{l[7]}"  style="width:100%" />
                    </p:column>
                    <p:column headerText="消耗类型" styleClass="column" style="width:100px">
                        <h:outputLabel value="#{equipmentDecomposeAction.getDecomName(l[8])}"  style="width:100%"/>
                    </p:column>
                    <p:column headerText="操作对象ID" styleClass="column" style="width:140px">
                        <h:outputLabel value="#{equipmentDecomposeAction.getItemName(l[9])}(#{l[9]})"  style="width:100%"/>
                    </p:column>
                    <p:column headerText="强化星级" styleClass="column" style="width:60px">
						<h:outputLabel value="#{l[10]}"  style="width:100%"/>
					</p:column>
				</p:dataTable>
			</p:panel>
		</div>
	</h:form>
	<!-- 页脚 -->
	<div class="footer"></div>
</h:body>
</html>